Skip to content

Add invalid-JSON test for append-run-log - #491

Closed
shaurya703 wants to merge 1 commit into
cobusgreyling:mainfrom
shaurya703:test/481-append-run-log-invalid-json
Closed

Add invalid-JSON test for append-run-log#491
shaurya703 wants to merge 1 commit into
cobusgreyling:mainfrom
shaurya703:test/481-append-run-log-invalid-json

Conversation

@shaurya703

Copy link
Copy Markdown

Fixes #481

Adds scripts/append-run-log.test.mjs locking in the behaviour from #474:

  • Invalid second arg (not JSON) exits with code 1 and prints a Usage message mentioning valid JSON (no stacktrace)
  • A valid minimal JSON entry parses and appends to a temp loop-run-log.md without throwing (temp file created and cleaned up inside the test — the real run log is untouched)

Run with:

node --test scripts/append-run-log.test.mjs

Results: 2 tests, 2 pass, 0 fail.

- Invalid second arg exits 1 and prints a Usage message mentioning
  valid JSON
- Valid minimal JSON entry appends to a temp log without throwing
- Run with: node --test scripts/append-run-log.test.mjs

Fixes cobusgreyling#481
@cobusgreyling

Copy link
Copy Markdown
Owner

Thanks for the contribution! Closing as a duplicate of the green PRs that just merged (same tests from the Wave 6 good-first-issue batch):

Your effort still matters — grab another good first issue anytime; we aim to review within 48h.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add invalid-JSON test for append-run-log

2 participants